#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <algorithm>
#define FOR(i,a,n) for(int i=a,_n(n);i<_n;++i)
#define REP(i,n) FOR(i,0,n)

using namespace std;

char ss[100010];
char sb[100010];

int GetType(int tlen)
{
	if(tlen>=4&&strcmp(sb+tlen-4,"lios")==0) return 0;
	if(tlen>=5&&strcmp(sb+tlen-5,"liala")==0) return 1;
	if(tlen>=3&&strcmp(sb+tlen-3,"etr")==0) return 2;
	if(tlen>=4&&strcmp(sb+tlen-4,"etra")==0) return 3;
	if(tlen>=6&&strcmp(sb+tlen-6,"initis")==0) return 4;
	if(tlen>=6&&strcmp(sb+tlen-6,"inites")==0) return 5;
	return -1;
}
bool Judge()
{
	vector<int> v;
	int slen = strlen(ss);
	for(int pos = 0;pos<slen;)
	{
		sscanf(ss+pos,"%s",sb);
		int tlen = strlen(sb);
		int tp = GetType(tlen);
		//cout<<tp<<endl;
		if(tp==-1) return false;
		v.push_back(tp);
		pos+=tlen+1;
	}
	//REP(i,v.size()) cout<<v[i]<<endl;
	if(v.size()==1) return true;
	int gender = v[0]&1;
	int state = -1;
	REP(i,v.size())
	{
		int t = v[i];
		if((t&1)!=gender) return false;
		int tp = t/2;
		//printf("id:%d state=%d tp=%d\n",i,state,tp);
		if(state<=0)
		{
			if(tp==2) return false;
			else state = tp;
		}
		else
		{
			if(tp!=2) return false;
			state = 2;
		}
	}
	if(state<1) return false;
	return true;
}
int main()
{
	while(gets(ss))
	{
		if(Judge()) puts("YES");
		else puts("NO");
	}
	return 0;
}
